home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 051-075 / disk_064 / examples / display / myreadpict.h < prev    next >
C/C++ Source or Header  |  1992-05-06  |  2KB  |  81 lines

  1. /* myreadpict.h */
  2.  
  3. #ifndef MYREADPICT_H
  4. #define MYREADPICT_H
  5.  
  6. #ifndef ILBM_H
  7. #include <iff/ilbm.h>
  8. #endif
  9.  
  10. #ifndef GRAPHICS_GFX_H
  11. #include <graphics/gfx.h>
  12. #endif
  13.  
  14.  
  15. #define EXDepth 6        /* Maximum depth (6=HAM) */
  16. #define maxColorReg 32
  17. #define maxCycles   8
  18. #define RNG_NORATE  36   /* Dpaint uses this rate to mean non-active */
  19.  
  20. typedef struct {
  21.    ULONG ViewModes;
  22.    } CamgChunk;
  23.  
  24. typedef struct {
  25.    WORD  pad1;   /* future exp - store 0 here */
  26.    WORD  rate;   /* 60/sec=16384, 30/sec=8192, 1/sec=16384/60=273 */
  27.    WORD  active; /* lo bit 0=no cycle, 1=yes; next bit 1=rvs */
  28.    UBYTE low;    /* range lower */
  29.    UBYTE high;   /* range upper */
  30.    } CrngChunk;
  31.  
  32. typedef struct {
  33.    WORD  direction;  /* 0=don't cycle, 1=forward, -1=backwards */
  34.    UBYTE start;      /* range lower */
  35.    UBYTE end;        /* range upper */
  36.    LONG  seconds;    /* seconds between cycling */
  37.    LONG  microseconds; /* msecs between cycling */
  38.    WORD  pad;        /* future exp - store 0 here */
  39.    } CcrtChunk;
  40.  
  41.  
  42. #define GetCAMG(context, camg)  \
  43.     IFFReadBytes(context, (BYTE *)camg, sizeof(CamgChunk))
  44.  
  45. #define ID_CRNG  MakeID('C','R','N','G')
  46. #define GetCRNG(context, crng)  \
  47.     IFFReadBytes(context, (BYTE *)crng, sizeof(CrngChunk))
  48.  
  49. #define ID_CCRT  MakeID('C','C','R','T')
  50. #define GetCCRT(context, ccrt)  \
  51.     IFFReadBytes(context, (BYTE *)ccrt, sizeof(CcrtChunk))
  52.  
  53.  
  54. typedef struct {
  55.    ClientFrame clientFrame;
  56.    UBYTE foundBMHD;
  57.    UBYTE nColorRegs;
  58.    BitMapHeader bmHdr;
  59.    Color4 colorMap[maxColorReg];
  60.    /* If you want to read any other property chunks, e.g. GRAB or CAMG, add
  61.     * fields to this record to store them. */
  62.    UBYTE foundCAMG;
  63.    CamgChunk camgChunk;
  64.    UBYTE cycleCnt;
  65.    CrngChunk crngChunks[maxCycles]; /* I'll convert CCRT to this */
  66.    } ILBMFrame;
  67.  
  68. typedef UBYTE *UBytePtr;
  69.  
  70. #ifdef FDwAT
  71. extern IFFP myReadPicture(LONG, ILBMFrame *);
  72. extern struct BitMap *getBitMap(ILBMFrame *);
  73. #else 
  74. extern IFFP myReadPicture();
  75. extern struct BitMap *getBitMap();
  76. #endif
  77.  
  78. #endif MYREADPICT_H
  79.  
  80.  
  81.